package business;

import java.util.List;

import models.Users;
import models.forms.LoginForm;
import dao.UserDao;
import dao.impl.UserDaoImpl;

public class UserBusiness {
	private UserDao userDao;

    public UserBusiness() {
            this.userDao = new UserDaoImpl();
    }

    public boolean checkExistByUsername(String username) {
            return this.userDao.checkExistByUsername(username);
    }
    
    public Users login(LoginForm form){
            return userDao.selectByUsernameAndPassword(form.getUsername(), form.getPassword());
    }
    
    public List<Users> selectAll(){
            return userDao.selectAll();
    }
}
